<div class="modal-header" style="padding-top:32px">
    <button type="button" class="close" ng-click="cancle()"  aria-hidden="true"></button>
    <h4 class="modal-title">
        <div class="caption">
            <i class=" icon-layers font-red"></i>
            <span class="caption-subject font-red sbold uppercase">{{title}}</span>
        </div>
    </h4>
</div>
<div class="modal-body">
    <form class="form-validation form-horizontal" method="post" name="form" novalidate>
        <div class="row">
            <div class="col-md-12">
                <div class="form-body">
                    <div class="form-group ">
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >用户名<span class="required">*</span></label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="" maxlength="20" required name="userName" ng-model="user.username"  required>
                            </div>
                        </div>
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >姓名<span class="required">*</span></label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="" maxlength="20" name="name" ng-model="user.realName"  required>
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >密码<span class="required">*</span></label>
                            <div class="col-md-8">
                                <input type="password" class="form-control" placeholder="" maxlength="20" required name="userPassword" ng-model="user.password"  required>
                            </div>
                        </div>
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >确认密码<span class="required">*</span></label>
                            <div class="col-md-8">
                                <input type="password" class="form-control" placeholder="" maxlength="20" required name="userPassword" ng-model="user.comUserPassword" required>
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >身份证号</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="" maxlength="20" name="idCardNo" ng-model="user.idCardNo"  >
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >联系方式</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" placeholder="" ng-pattern="/^[0-9]+$/" maxlength="20" name="linkPhone" ng-model="user.linkPhone"  >
                            </div>
                        </div>
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >邮箱</label>
                            <div class="col-md-8">
                                <input type="email" class="form-control" placeholder="" maxlength="20" name="email" ng-model="user.email"  >
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >代理商<span class="required">*</span></label>
                            <div class="col-md-8">
                                <ui-select allow-clear ng-model="user.tenantId" theme="bootstrap" ng-change="activeTenant()" required="true">
                                    <ui-select-match placeholder="请选择..." class="">{{$select.selected.value.name}}</ui-select-match>
                                    <ui-select-choices repeat="item.key as (key, item)  in tenant | filter: { value: { name: $select.search }}">
                                        <span ng-bind-html="item.value.name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <div class="form-control-focus"> </div>
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="col-md-6 form-group form-md-line-input " >
                            <label class="col-md-4 control-label" >所属角色<span class="required">*</span></label>
                            <div class="col-md-8">
                                <ui-select allow-clear ng-model="user.role" theme="bootstrap" required="true">
                                    <ui-select-match placeholder="请选择..." class="">{{$select.selected.value.name}}</ui-select-match>
                                    <ui-select-choices repeat="item.key as (key, item)  in role | filter: { value: { name: $select.search }}">
                                        <span ng-bind-html="item.value.name | highlight: $select.search"></span>
                                    </ui-select-choices>
                                </ui-select>
                                <div class="form-control-focus"> </div>
                                <span class="help-block"></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group ">
                        <div class="col-md-12 form-group form-md-line-input " >
                            <label class="col-md-2 control-label" >备注</label>
                            <div class="col-md-10">
                                <textarea class="form-control" rows="3" ng-model="user.remarks"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button type="button" class="btn default" data-dismiss="modal" ng-click="cancle()">关闭</button>
    <button type="submit" class="btn blue" ng-click="ok(form.$valid)" ng-disabled="form.$invalid">保存</button>
</div>